Page({
    data: {
      userInfo: null
    },
  
    onLoad() {
      const userInfo = wx.getStorageSync('userInfo');
      this.setData({
        userInfo: userInfo
      });
    },
  
    // 退出登录
    handleLogout() {
      wx.showModal({
        title: '提示',
        content: '确定要退出登录吗？',
        success: (res) => {
          if (res.confirm) {
            wx.clearStorageSync();
            wx.reLaunch({
              url: '/pages/login/login'
            });
          }
        }
      });
    }
  });